<?php

function greengar_rename($user_guid, $name) {
    $userEntity = get_entity($user_guid);
    
    if(!$userEntity) {
        return NULL;
    }
    $userEntity->set('name', $name);
    
            
    $userEntity->name = $name;
    $userEntity->save();
    /*
    if(!$userEntity->save()) {
        return NULL;
    }
    $userEntity = NULL;
    $userEntity = get_entity($user_guid);
    $testEntity = get_entity($user_guid);
    */
    return $userEntity;
}

function greengar_set_gender($user_guid, $gender) {
    $userEntity = get_entity($user_guid);
    
    if(!$userEntity) {
        return NULL;
    }
    //$userEntity->set('name', $name);
    
            
    $userEntity->gender = $gender;
    $userEntity->save();
    /*
    if(!$userEntity->save()) {
        return NULL;
    }
    $userEntity = NULL;
    $userEntity = get_entity($user_guid);
    $testEntity = get_entity($user_guid);
    */
    return $userEntity;
}

function greengar_set_dob($user_guid, $dob) {
    $userEntity = get_entity($user_guid);
    
    if(!$userEntity) {
        return NULL;
    }
    //$userEntity->set('name', $name);
    
            
    $userEntity->dob = $dob;
    $userEntity->save();
    /*
    if(!$userEntity->save()) {
        return NULL;
    }
    $userEntity = NULL;
    $userEntity = get_entity($user_guid);
    $testEntity = get_entity($user_guid);
    */
    return $userEntity;
}

?>